<?php

namespace App\Common\Admin;


class Admin extends _Base
{
    /**
     * 获取验证码
     *
     * @return mixed
     * @throws \Exception
     */
    public function funcGetVCode()
    {
        $key = self::funcVCodeKey__redis($this->context()->get('ip'));

        $vcode = $this->redis()->get($key);


        return $vcode;
    }

    /**
     * 判断验证码是否正确
     *
     * @param $code
     * @return bool
     * @throws \Exception
     */
    public function funcCheckVCode($code)
    {
        $vcode = $this->funcGetVCode();
        if ($code === $vcode)
        {
            return true;
        }


        return false;
    }
}